package demo2;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-09-07
 * Time: 16:54
 */
public class Test3 {
    public synchronized void func1(){
        func2();
    }
    public void func2(){
        synchronized (this){
            synchronized (this){
                synchronized (this){
                    ……;
                }
            }
        };
    }
    private final int in = 0;
    private Object locker1 = new Object();
    private Object locker2 = new Object();
    private Object locker3 = new Object();
    private Object locker4 = new Object();
    private Object locker5 = new Object();

    private void func5(){
        synchronized (locker1){
            synchronized (locker3){
                synchronized (locker5){
                    ;
                }
            }
        }
    }

    private void func6(){
        synchronized (locker2){
            synchronized (locker3){
                synchronized (locker4){
                    ;
                }
            }
        }
    }


    public void func3(){
        synchronized (locker1){
            synchronized (locker2){
                ;
            }
        }
    }
    public void func4(){
        synchronized (locker2){
            synchronized (locker1){
                ;
            }
        }
    }

}
